<table id="listing_tbl" cellpadding="0" cellspacing="0">
	<tr>
		<th width="70px">Item #</th>
		<th>Item Name</th>
		<th>Stock</th>
		<th>Unit</th>
		<th>Whole Sale</th>
		<th>Total WP</th>
		<th>Retail Price</th>
		<th>Total RP</th>
		<th width="100px">Options</th>
	</tr>
	<?if($items->num_rows()):?>
	<?foreach($items->result() as $data):?>
		<tr>
			<td><?=str_pad($data->item_id, 4, "0", STR_PAD_LEFT);?></td>
			<td><?=$data->item_name;?></td>
			<td><?=$data->item_quantity?></td>
			<td><?=$data->item_unit?></td>
			<td>P <?=number_format($data->item_whole_sale_price,2,'.',',')?></td>
			<td>P <?=number_format($data->item_whole_sale_price*$data->item_quantity,2,'.',',')?></td>
			<td>P <?=number_format($data->item_retail_price,2,'.',',')?></td>
			<td>P <?=number_format($data->item_retail_price*$data->item_quantity,2,'.',',')?></td>
			<td>
				<?=anchor("inventory/update_inv/{$data->item_id}", '<img src="html/img/box_48.png" height="20px" width="20px"/>', 'class="inv_button"')?>
				<?=anchor("inventory/add_edit_item/{$data->item_id}", '<img src="html/img/app_48.png" height="20px" width="20px"/>', 'class="edit_item_button"')?>
				<?=anchor("inventory/delete_item/{$data->item_id}", '<img src="html/img/cancel_48.png" height="20px" width="20px"/>', 'class="delete_item_button"')?>
			</td>
		</tr>
	<?endforeach;?>
	<?if(!$search):?>
		<tr>
			<td colspan="5"><b>GRAND TOTAL:</b></td>
			<td>P <?=number_format($gt_wsp,2,'.',',')?></td>
			<td></td>
			<td>P <?=number_format($gt_rp,2,'.',',')?></td>
			<td></td>
		</tr>
	<?endif;?>
	<?else:?>
		<tr>
			<td colspan="11">No Items in Inventory.</td>
		</tr>
	<?endif;?>
</table>